package com.hkyp.ss.course.web.dto.request;


import com.hkyp.ss.course.web.dto.base.BaseDTO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;


@Data
public class WebLoginDTO extends BaseDTO {



    @ApiModelProperty(value = "邮箱")
    @Pattern(regexp = "^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\\.[a-zA-Z0-9_-]{2,3}){1,2})$",
            message = "请输入正确格式邮箱")
    @NotBlank(message = "邮箱不能为空")
    private String email;


    @ApiModelProperty(value = "密码")
    @NotBlank(message = "密码不能为空")
    @Length(min=6, max=20, message="用户名长度必须在8-32之间")
    // 6-20 位，字母、数字、字符
    @Pattern(regexp = "^([A-Z]|[a-z]|[0-9]|[`~!@#$%^&*()+=|{}':;',\\\\[\\\\].<>/?~！@#￥%……&*（）——+|{}【】‘；：”“'。，、？]){6,20}$",
            message = "密码需在6到20位之内，可包含字母、数字、字符")
    private String password;

    @ApiModelProperty(value="验证码(非必传/暂废弃)",hidden = true)
    @Pattern(regexp = "\\d{3,6}",
            message = "验证码格式不对")
    private String code;

    @ApiModelProperty(value="ip",hidden = true)
    private String ip;

    @ApiModelProperty(value="用户id",hidden = true)
    private String userId;

}
